﻿<navigation:Page x:Class="QSHC.QSchedule.Silverlight.Views.HolidayPage" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           xmlns:custom="clr-namespace:QSHC.CustomControl;assembly=QSHC.CustomControl"
           xmlns:vm="clr-namespace:QSHC.QSchedule.Silverlight.ViewModels"
           xmlns:converter="clr-namespace:QSHC.QSchedule.Silverlight.Converters"
           mc:Ignorable="d" Language="th-TH"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="970" d:DesignHeight="600"
           Title="HolidayPage" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit">
    
    <navigation:Page.Resources>
        <vm:HolidayViewModel x:Key="holidayViewModel" />
        <converter:PhysicianToTextConverter x:Key="physicianToTextConverter" />
    </navigation:Page.Resources>
    
    <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource holidayViewModel}}">
        <StackPanel Orientation="Horizontal">

            <StackPanel>
                <toolkit:GlobalCalendar RenderTransformOrigin="0,0" HorizontalAlignment="Left" Margin="95,0,5,5" Height="Auto" Name="scheduleCalendar" SelectedDate="{Binding Path=SelectedDate, Mode=TwoWay}" FontFamily="Tahoma">
                    <toolkit:GlobalCalendar.RenderTransform>
                        <CompositeTransform ScaleX="1.5" ScaleY="1.5"/>
                    </toolkit:GlobalCalendar.RenderTransform>
                </toolkit:GlobalCalendar>

                <StackPanel Margin="0,80,0,0" Orientation="Horizontal">
                    <TextBlock Text="วันที่เลือก:" Width="75" Margin="5" Style="{StaticResource TextBlockStyle}" TextAlignment="Right" />
                    <TextBlock Width="260" Text="{Binding StringFormat=\{0:D\}, Path=SelectedDate, Mode=TwoWay}" Style="{StaticResource TextBlockStyle}"/>

                </StackPanel>
                
                <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                    <TextBlock Text="รายละเอียด:" Width="75" Margin="5" Style="{StaticResource TextBlockStyle}" TextAlignment="Right" />
                    <TextBox Width="260" Text="{Binding Path=Name, Mode=TwoWay}" Style="{StaticResource TextBoxStyle}" Name="NameTextBox" />
                    
                </StackPanel>
                <StackPanel Orientation="Horizontal" Margin="0,5,0,0">
                    <StackPanel>
                        <TextBlock Text="หมายเหตุ:" Width="75" Margin="5" Style="{StaticResource TextBlockStyle}" TextAlignment="Right" />
                    </StackPanel>
                    <TextBox Width="260" Text="{Binding Path=Remark, Mode=TwoWay}" Style="{StaticResource TextBoxStyle}" Height="100" />

                </StackPanel>
                <StackPanel HorizontalAlignment="Right" Margin="0,10,0,0">
                    <Button Name="AddButton" Content="เพิ่ม" Command="{Binding Path=AddCommand}" Width="70" Height="30" Cursor="Hand" Style="{StaticResource ButtonStyle}" Margin="15,0,0,0" CommandParameter="{Binding ElementName=AddButton}" />
                </StackPanel>
                <toolkit:BusyIndicator Height="107" Width="170" IsBusy="{Binding Path=IsBusy, Mode=TwoWay}" />
            </StackPanel>

            <StackPanel Margin="20,4,0,0">
                <sdk:DataGrid  AutoGenerateColumns="False" Width="600" Height="530" ItemsSource="{Binding Path=Holidays}" SelectedItem="{Binding Path=SelectedHoliday, Mode=TwoWay}" FontFamily="Tahoma" FontSize="14">
                    <sdk:DataGrid.Columns>
                        <sdk:DataGridTextColumn Header="วันที่" Binding="{Binding Path=HolidayDate, StringFormat=\{0:D\}}" />
                        <sdk:DataGridTextColumn Header="รายละเอียด" Binding="{Binding Path=Name}" />
                        <sdk:DataGridTextColumn Header="หมายเหตุ" Binding="{Binding Path=Remark}" />
                    </sdk:DataGrid.Columns>
                </sdk:DataGrid>
                <Button Content="ลบ" Height="30" Name="button1" Width="75" Command="{Binding Path=DeleteCommand}" Style="{StaticResource ButtonStyle}" Cursor="Hand" Margin="0,10,0,0" />
            </StackPanel>
            
        </StackPanel>
    </Grid>
</navigation:Page>
